function T = dynamic_resid_tt(T, y, x, params, steady_state, it_)
% function T = dynamic_resid_tt(T, y, x, params, steady_state, it_)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double  vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double  vector of endogenous variables in the order stored
%                                                    in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double  matrix of exogenous variables (in declaration order)
%                                                    for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double  vector of steady state values
%   params        [M_.param_nbr by 1]        double  vector of parameter values in declaration order
%   it_           scalar                     double  time period for exogenous variables for which
%                                                    to evaluate the model
%
% Output:
%   T           [#temp variables by 1]       double  vector of temporary terms
%

assert(length(T) >= 21);

TEF_0 = int_capital(y(47),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(13),params(14));
T(1) = TEF_0;
TEF_1 = int_profit(y(47),y(24),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(5),params(13),params(14),params(4));
T(2) = TEF_1;
TEF_2 = int_money(y(47),y(24),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(5),params(13),params(14),params(4));
T(3) = TEF_2;
TEF_3 = int_liq(y(47),y(24),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(5),params(12),params(13),params(14),params(4),y(36)/y(2));
T(4) = TEF_3;
T(5) = params(1)/y(58)*(1-params(4))*y(56);
T(6) = params(52)+y(55)*params(10)*(1-params(9))*y(60)+params(12)*params(9)*y(55)*params(10)*(1-params(8))*y(61)+params(14)*params(9)*y(55)*params(10)*y(62);
T(7) = params(1)/y(58)/(1+y(57));
T(8) = y(24)/y(54)/(1-params(3));
TEF_4 = int_surplus(y(36)/y(2),1,y(24),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(5),params(13),params(14),params(12),params(4));
T(9) = TEF_4;
T(10) = (log(y(48))-params(20))/params(21)/1.414213562373095;
TEF_5 = average_log_normal(y(48),params(20),params(21));
T(11) = TEF_5;
TEF_6 = int_partial(y(47),y(24),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(5),params(12),params(13),params(14),params(4),y(36)/y(2));
T(12) = TEF_6;
TEF_7 = int_acquisition(y(47),y(24),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(5),params(13),params(14),params(4));
T(13) = TEF_7;
T(14) = (params(3)/y(40))^(1/(1-params(3)));
T(15) = y(54)*T(14);
T(16) = y(54)^(1-params(3));
T(17) = y(33)*T(16);
T(18) = y(2)^(1-params(3));
T(19) = y(37)^params(3);
TEF_8 = int_2nd_price(y(47),y(24),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(5),params(4));
T(20) = TEF_8;
TEF_9 = int_prod_disp(y(47),y(24),params(53),params(53),params(16),params(17),params(18),params(19),params(9),params(8),y(5),params(4),params(10)*y(17));
T(21) = TEF_9;

end
